import 'package:flutter/material.dart';

void main() {
  // 1.运行应用程序
  runApp(const MaterialApp(home: Main()));
}

class Main extends StatelessWidget {
  const Main({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          'Image  组件---网络图',
          style: TextStyle(color: Colors.white),
        ),
        backgroundColor: Colors.black,
      ),
      body: Center(
        child: Container(
          width: 300,
          height: 300,
          color:Colors.amber,
          child: Image.network( 'https://yanxuan-item.nosdn.127.net/e529b6ab111ade9da9314867f98d360f.png',
          // width: 200, //container为主
          // height: 200,
          fit: BoxFit.contain,

          )
        ),
      ),
    );
  }
}
